<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客编辑页</title>
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/blog_edit.css">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
    <!-- 引入 editor.md 的依赖 -->
    <link rel="stylesheet" href="./editor.md/css/editormd.min.css" />
    <script src="./editor.md/lib/marked.min.js"></script>
    <script src="./editor.md/lib/prettify.min.js"></script>
    <script src="./editor.md/editormd.js"></script>
</head>
<body>
    <div class="nav">
        <img src="./image/logo2.jpg" alt="">
        <div class="title">我的博客系统</div>
        <div class="spacer"></div>
        <a href="blog_list.html">主页</a>
        <a href="blog_edit.html">写博客</a>
        <a href="logout">注销</a>
    </div>

   
    <div class="blog-edit-container">
        <form action="blog" method="post">
            <div class="title">
                <input type="text" id="title-input" name="title">
                <input type="submit" id="submit" value="提交">
            </div>
            <div id="editor">
                <!-- 隐藏文本域 -->
                <textarea name="content" style="display: none;"></textarea>
            </div>
        </form>
    </div>

    <script src="./js/app.js"></script>
    <script>
        var editor = editormd("editor", {
            // 这里的尺寸必须在这里设置. 设置样式会被 editormd 自动覆盖掉. 
            width: "100%",
            // 设定编辑器高度
            height: "calc(100% - 50px)",
            // 编辑器中的初始内容
            markdown: "# 在这里写下一篇博客",
            // 指定 editor.md 依赖的插件路径
            path: "editor.md/lib/",
            saveHTMLToTextarea:true
        });

        //判断用户当前是否为已登录状态
        getLoginStatus();
    </script>
</body>
</html>